package chixing.day07_inherited.HomeWork;

public class PartTimeEmployee extends MyEmployee {
    private double hourWorked;
    private double hourlyRate;
    public void calculateSalary(){
        double salary = hourWorked*hourlyRate;
        System.out.println("总工资="+(getEmpBaseSalary()+salary));
    }

    public PartTimeEmployee(double hourWorked, double hourlyRate) {
        this.hourWorked = hourWorked;
        this.hourlyRate = hourlyRate;
    }

    public PartTimeEmployee(String empNo, String empName, double empBaseSalary, double hourWorked, double hourlyRate) {
        super(empNo, empName, empBaseSalary);
        this.hourWorked = hourWorked;
        this.hourlyRate = hourlyRate;
    }

    public double getHourWorked() {
        return hourWorked;
    }

    public void setHourWorked(double hourWorked) {
        this.hourWorked = hourWorked;
    }

    public double getHourlyRate() {
        return hourlyRate;
    }

    public void setHourlyRate(double hourlyRate) {
        this.hourlyRate = hourlyRate;
    }

    @Override
    public String toString() {
        return "PartTimeEmployee{" +
                "hourWorked=" + hourWorked +
                ", hourlyRate=" + hourlyRate +
                "} " + super.toString();
    }
}
